package com.aspose.cells;

class zbbi extends zp {
   private zbpx a;
   private zaau b;
   private zbax c;
   private int d;
   private int e;
   private int f;
   private int g;
   private int h = -1;
   private byte[] i;
   private zakl j;
   private byte[] k = new byte[14];
   private byte l;
   private byte m;

   public zbbi(zbax var1, int var2, zbpx var3, zaau var4) {
      this.a = var3;
      this.b = var4;
      this.c = var1;
      this.e = var2;
      this.p();
      this.d = this.m(this.f + 5, (this.i[this.f + 4] & 255 & 3) + 1);
   }

   public zbbi(zbax var1, zbpx var2, zaau var3, Object var4) {
      this.a = var2;
      this.b = var3;
      this.c = var1;
      int[] var5 = (int[])((int[])var4);
      this.e = var5[var5.length - 1];
      this.p();
      this.d = var5[var5.length - 2];
      this.h = var5[var5.length - 3];
      this.j = new zakl(var5, var5.length - 3);
   }

   private void p() {
      this.i = this.c.h(this.e);
      this.f = this.c.i(this.e);
      this.g = this.c.j(this.e);
      this.l = this.i[this.f + 2];
      this.m = this.i[this.f + 3];
   }

   byte[] l() {
      return this.i;
   }

   int m() {
      return this.e;
   }

   int n() {
      return this.h > -1 ? this.h : d(this.i, this.f, this.g);
   }

   int o() {
      return this.f;
   }

   private int q() {
      byte var1 = this.i[this.f + 4];
      return 5 + (var1 & 255 & 3) + ((var1 & 255 & 4) == 0 ? 2 : 3) + ((var1 & 255 & 24) >> 3);
   }

   private void r() {
      if (this.j == null) {
         this.j = new zakl(Math.max((this.g - this.f) / 7, 10));
      } else {
         this.j.c();
      }

      int var1;
      for(var1 = this.f + this.q(); var1 < this.g && this.i[var1] != 0; var1 += this.r(var1)) {
         this.j.a(var1);
      }

      this.h = var1;
   }

   private int r(int var1) {
      if (this.i[var1] == 0) {
         return 0;
      } else {
         byte var2 = this.i[var1];
         return (var2 & 255 & 3) + ((var2 & 255 & 4) == 0 ? 2 : 3) + t(var2 & 255 & 248);
      }
   }

   private int s(int var1) {
      byte var2 = this.i[var1];
      return var1 + (var2 & 255 & 3) + ((var2 & 255 & 4) == 0 ? 2 : 3);
   }

   private static int t(int var0) {
      switch(var0) {
      case 8:
      case 40:
      case 64:
      case 128:
      case 192:
         return 1;
      case 24:
      case 56:
      case 80:
      case 144:
      case 208:
         return 2;
      case 32:
         return 8;
      case 48:
      case 112:
      case 176:
      case 240:
         return 4;
      case 96:
      case 160:
      case 224:
         return 3;
      default:
         return 0;
      }
   }

   private static int u(int var0) {
      if (var0 > 16777215) {
         return 4;
      } else if (var0 > 65535) {
         return 3;
      } else {
         return var0 > 255 ? 2 : 1;
      }
   }

   private int a(zfv var1, int var2, int var3) {
      int var4 = this.b(var1, var2, var3);
      return var4 + this.a(var1, var4);
   }

   private int b(zfv var1, int var2, int var3) {
      int var4 = var2;
      int var5 = 0;
      byte var6 = 1;
      byte var7 = 0;
      int var9;
      if ((var3 & 1) != 0) {
         if (var1.a > 255) {
            var7 = (byte)(var7 | 4);
            this.q(var6, var1.a);
            var9 = var6 + 2;
         } else {
            var9 = var6 + 1;
            this.k[var6] = (byte)var1.a;
         }

         if ((var3 & 2) == 0) {
            var4 = this.j.b(var2);
            var5 = this.i[var4];
            var4 += (var5 & 255 & 4) != 0 ? 3 : 2;
         }
      } else {
         var4 = this.j.b(var2);
         var5 = this.i[var4];
         ++var4;
         if ((var5 & 255 & 4) != 0) {
            var7 = (byte)(var7 | 4);
            var9 = var6 + 1;
            this.k[var6] = this.i[var4++];
            this.k[var9++] = this.i[var4++];
         } else {
            var9 = var6 + 1;
            this.k[var6] = this.i[var4++];
         }
      }

      if ((var3 & 2) != 0) {
         int var8 = var1.b - 15;
         if (var8 > -1) {
            if (var8 <= 255) {
               var7 = (byte)(var7 | 1);
               this.k[var9++] = (byte)var8;
            } else if (var8 < 65535) {
               var7 = (byte)(var7 | 2);
               this.q(var9, var8);
               var9 += 2;
            } else {
               var7 = (byte)(var7 | 3);
               this.r(var9, var8);
               var9 += 3;
            }
         }
      } else {
         switch(var5 & 255 & 3) {
         case 0:
            var7 = (byte)(var7 | 1);
            this.k[var9++] = this.i[var4++];
            break;
         case 1:
            var7 = (byte)(var7 | 2);
            this.k[var9++] = this.i[var4++];
            this.k[var9++] = this.i[var4++];
            break;
         case 2:
            var7 = (byte)(var7 | 3);
            this.k[var9++] = this.i[var4++];
            this.k[var9++] = this.i[var4++];
            this.k[var9++] = this.i[var4++];
         }
      }

      this.k[0] = var7;
      return var9;
   }

   private int a(zfv var1, int var2) {
      int var3;
      switch(var1.c) {
      case 1:
         this.k[0] = (byte)(this.k[0] | 32);
         long var5 = Double.doubleToRawLongBits((Double)var1.d);
         this.k[var2] = (byte)((int)(var5 & 255L));
         this.k[var2 + 1] = (byte)((int)(var5 >> 8 & 255L));
         this.k[var2 + 2] = (byte)((int)(var5 >> 16 & 255L));
         this.k[var2 + 3] = (byte)((int)(var5 >> 24 & 255L));
         this.k[var2 + 4] = (byte)((int)(var5 >> 32 & 255L));
         this.k[var2 + 5] = (byte)((int)(var5 >> 40 & 255L));
         this.k[var2 + 6] = (byte)((int)(var5 >> 48 & 255L));
         this.k[var2 + 7] = (byte)((int)(var5 >> 56));
         return 8;
      case 2:
         this.k[0] = (byte)(this.k[0] | ((Boolean)var1.d ? 72 : 88));
         return 0;
      case 3:
         switch((Byte)var1.d) {
         case -2:
            this.k[0] = (byte)(this.k[0] | 216);
            return 0;
         case 0:
            this.k[0] = (byte)(this.k[0] | 120);
            return 0;
         case 7:
            this.k[0] = (byte)(this.k[0] | 104);
            return 0;
         case 15:
            this.k[0] = (byte)(this.k[0] | 136);
            return 0;
         case 23:
            this.k[0] = (byte)(this.k[0] | 152);
            return 0;
         case 29:
            this.k[0] = (byte)(this.k[0] | 168);
            return 0;
         case 36:
            this.k[0] = (byte)(this.k[0] | 184);
            return 0;
         case 42:
            this.k[0] = (byte)(this.k[0] | 200);
            return 0;
         default:
            this.k[0] = (byte)(this.k[0] | 232);
            return 0;
         }
      case 4:
         var3 = ((zayy)var1.d).e;
         if (var3 < 255) {
            this.k[0] = (byte)(this.k[0] | (var1.e ? 128 : 64));
            this.k[var2] = (byte)var3;
            return 1;
         } else if (var3 <= 65535) {
            this.k[0] = (byte)(this.k[0] | (var1.e ? 144 : 80));
            this.q(var2, var3);
            return 2;
         } else {
            if (var3 <= 16777215) {
               this.k[0] = (byte)(this.k[0] | (var1.e ? 160 : 96));
               this.r(var2, var3);
               return 3;
            }

            this.k[0] = (byte)(this.k[0] | (var1.e ? 176 : 112));
            this.s(var2, var3);
            return 4;
         }
      case 5:
         var3 = ((zyi)var1.d).a;
         if (var3 < 255) {
            this.k[0] = (byte)(this.k[0] | 192);
            this.k[var2] = (byte)var3;
            return 1;
         } else if (var3 <= 65535) {
            this.k[0] = (byte)(this.k[0] | 208);
            this.q(var2, var3);
            return 2;
         } else {
            if (var3 <= 16777215) {
               this.k[0] = (byte)(this.k[0] | 224);
               this.r(var2, var3);
               return 3;
            }

            this.k[0] = (byte)(this.k[0] | 240);
            this.s(var2, var3);
            return 4;
         }
      case 6:
         var3 = (Integer)var1.d;
         if ((var3 & 3) == 2) {
            int var4 = this.u(var3 >> 2, var2);
            if (var4 > -1) {
               return var4;
            }
         }

         this.k[0] = (byte)(this.k[0] | 48);
         this.k[var2] = (byte)(var3 & 255);
         this.k[var2 + 1] = (byte)(var3 >> 8 & 255);
         this.k[var2 + 2] = (byte)(var3 >> 16 & 255);
         this.k[var2 + 3] = (byte)(var3 >> 24 & 255);
         return 4;
      default:
         this.k[0] = (byte)(this.k[0] | 16);
         return 0;
      }
   }

   private int m(int var1, int var2) {
      switch(var2) {
      case 1:
         int var3 = this.i[var1] & 255;
         return var3;
      case 2:
         return (this.i[var1] & 255) << 8 | this.i[var1 + 1] & 255;
      case 3:
         return (this.i[var1] & 255) << 16 | (this.i[var1 + 1] & 255) << 8 | this.i[var1 + 2] & 255;
      case 4:
         return (this.i[var1] & 255) << 24 | (this.i[var1 + 1] & 255) << 16 | (this.i[var1 + 2] & 255) << 8 | this.i[var1 + 3] & 255;
      default:
         return -1;
      }
   }

   private void b(int var1, int var2, int var3) {
      switch(var3) {
      case 1:
         this.i[var1] = (byte)var2;
         break;
      case 2:
         this.n(var1, var2);
         break;
      case 3:
         this.o(var1, var2);
         break;
      case 4:
         this.p(var1, var2);
      }

   }

   private void n(int var1, int var2) {
      this.i[var1] = (byte)(var2 >> 8);
      this.i[var1 + 1] = (byte)(var2 & 255);
   }

   private void o(int var1, int var2) {
      this.i[var1] = (byte)(var2 >> 16);
      this.i[var1 + 1] = (byte)(var2 >> 8 & 255);
      this.i[var1 + 2] = (byte)(var2 & 255);
   }

   private void p(int var1, int var2) {
      this.i[var1] = (byte)(var2 >> 24);
      this.i[var1 + 1] = (byte)(var2 >> 16 & 255);
      this.i[var1 + 2] = (byte)(var2 >> 8 & 255);
      this.i[var1 + 3] = (byte)(var2 & 255);
   }

   private void q(int var1, int var2) {
      this.k[var1] = (byte)(var2 >> 8);
      this.k[var1 + 1] = (byte)(var2 & 255);
   }

   private void r(int var1, int var2) {
      this.k[var1] = (byte)(var2 >> 16);
      this.k[var1 + 1] = (byte)(var2 >> 8 & 255);
      this.k[var1 + 2] = (byte)(var2 & 255);
   }

   private void s(int var1, int var2) {
      this.k[var1] = (byte)(var2 >> 24);
      this.k[var1 + 1] = (byte)(var2 >> 16 & 255);
      this.k[var1 + 2] = (byte)(var2 >> 8 & 255);
      this.k[var1 + 3] = (byte)(var2 & 255);
   }

   private void s() {
      ++this.i[this.f + 2];
      ++this.l;
   }

   private void t() {
      this.m = (byte)Math.min(255, this.h - this.f - 7);
      this.i[this.f + 3] = this.m;
      if (this.h < this.g) {
         this.i[this.h] = 0;
      }

   }

   private int v(int var1) {
      int var2 = var1 - (this.g - this.h);
      if (var2 > 0) {
         this.e = this.c.a(this.e, this.f, this.h, this.g, var2);
         return this.u();
      } else {
         return 0;
      }
   }

   private int u() {
      this.i = this.c.h(this.e);
      int var1 = this.c.i(this.e) - this.f;
      if (var1 != 0) {
         int[] var2 = this.j.d();
         int var3 = this.j.a();

         for(int var4 = 0; var4 < var3; ++var4) {
            var2[var4] += var1;
         }

         this.h += var1;
         this.f += var1;
      }

      this.g = this.c.j(this.e);
      if (this.h < this.g) {
         this.i[this.h] = 0;
      }

      return var1;
   }

   private int c(int var1, int var2, int var3) {
      int var5 = this.v(var3);
      int var4 = var2 + var5;
      System.arraycopy(this.i, var4, this.i, var4 + var3, this.h - var4);
      if (var1 < this.j.a()) {
         int[] var6 = this.j.d();

         for(int var7 = this.j.a(); var1 < var7; ++var1) {
            var6[var1] += var3;
         }
      }

      this.h += var3;
      this.t();
      return var5;
   }

   public int a() {
      if (this.h < 0) {
         this.r();
      }

      return this.j.a();
   }

   public int f() {
      this.e = this.c.b(this.d, this.e);
      if (this.e < 0) {
         return this.e;
      } else {
         this.f(this.e);
         return this.e;
      }
   }

   public void g() {
      this.f();
   }

   public void f(int var1) {
      this.e = var1;
      this.i = this.c.h(this.e);
      int var2 = this.c.i(this.e) - this.f;
      if (var2 != 0) {
         this.f += var2;
      }

      this.g = this.c.j(this.e);
      if (this.l != this.i[this.f + 2]) {
         this.l = this.i[this.f + 2];
         this.m = this.i[this.f + 3];
         this.h = -1;
         this.j = null;
      } else if (this.m != this.i[this.f + 3]) {
         this.m = this.i[this.f + 3];
         this.h = -1;
         this.j = null;
      } else if (var2 != 0 && this.h > -1) {
         int[] var3 = this.j.d();

         for(int var4 = this.j.a() - 1; var4 > -1; --var4) {
            var3[var4] += var2;
         }

         this.h += var2;
      }

   }

   public int b(int var1) {
      if (this.h < 0) {
         this.r();
      }

      return this.j.a() < 1 ? -1 : this.a(var1, -1, -1);
   }

   public int a(int var1, int var2) {
      int var3 = var2;
      if (this.h < 0) {
         this.r();
      }

      if (this.j.a() < 1) {
         return -1;
      } else {
         if (var2 >= this.j.a()) {
            var3 = this.j.a() - 1;
         } else if (var2 < 0) {
            var3 = 0;
         }

         int var4 = this.a(var3);
         if (var4 == var1) {
            return var3;
         } else if (var4 > var1) {
            return var3 == 0 ? -1 : this.a(var1, var3 - (var4 - var1), var3 - 1);
         } else {
            return var3 == this.j.a() - 1 ? -this.j.a() - 1 : this.a(var1, var3 + 1, var3 + (var1 - var4));
         }
      }
   }

   public int a(int var1, int var2, int var3) {
      int var4 = var2;
      int var5 = var3;
      if (this.h < 0) {
         this.r();
      }

      if (var2 < 0) {
         var4 = 0;
      } else if (var2 >= this.j.a()) {
         return -this.j.a() - 1;
      }

      int var6 = this.a(var4);
      if (var1 == var6) {
         return var4;
      } else if (var1 < var6) {
         return -var4 - 1;
      } else {
         if (var3 < 0 || var3 >= this.j.a()) {
            var5 = this.j.a() - 1;
         }

         if (var4 == var5) {
            return -var5 - 2;
         } else {
            var5 = Math.min(var5, var4 + (var1 - var6));
            var6 = this.a(var5);
            if (var1 == var6) {
               return var5;
            } else if (var1 > var6) {
               return -var5 - 2;
            } else {
               var4 = Math.max(var4 + 1, var5 - (var6 - var1));
               --var5;
               if (var5 < var4) {
                  return -var4 - 1;
               } else if (var5 == var4) {
                  var6 = this.a(var5);
                  if (var1 < var6) {
                     return -var5 - 1;
                  } else {
                     return var1 == var6 ? var5 : -var5 - 2;
                  }
               } else {
                  while(true) {
                     int var7 = var4 + var5 >> 1;
                     var6 = this.a(var7);
                     if (var7 == var4) {
                        if (var1 == var6) {
                           return var4;
                        }

                        if (var1 < var6) {
                           return -var4 - 1;
                        }

                        if (var4 < var5) {
                           var6 = this.a(var5);
                           if (var1 == var6) {
                              return var5;
                           }

                           if (var1 < var6) {
                              return -var5 - 1;
                           }
                        }

                        return -var5 - 2;
                     }

                     if (var1 < var6) {
                        var5 = var7 - 1;
                        if (var5 == var4) {
                           var6 = this.a(var4);
                           if (var1 == var6) {
                              return var4;
                           }

                           if (var1 < var6) {
                              return -var4 - 1;
                           }

                           return -var7 - 1;
                        }

                        var4 = Math.max(var4, var7 - (var6 - var1));
                     } else {
                        if (var1 == var6) {
                           return var7;
                        }

                        var4 = var7 + 1;
                        if (var5 == var4) {
                           var6 = this.a(var4);
                           if (var1 == var6) {
                              return var4;
                           }

                           if (var1 > var6) {
                              return -var4 - 2;
                           }

                           return -var4 - 1;
                        }

                        var5 = Math.min(var5, var7 + (var1 - var6));
                     }
                  }
               }
            }
         }
      }
   }

   public int b(int var1, int var2) {
      if (this.h < 0) {
         this.r();
      }

      if (var2 < 0) {
         var2 = 0;
      } else if (var2 >= this.j.a()) {
         if (this.j.a() < 1) {
            return -1;
         }

         var2 = this.j.a();
      }

      int var3 = this.a(var2);
      if (var1 == var3) {
         return var2;
      } else if (var1 < var3) {
         do {
            --var2;
            if (var2 < 0) {
               return -1;
            }

            var3 = this.a(var2);
            if (var3 == var1) {
               return var2;
            }
         } while(var3 >= var1);

         return -var2 - 2;
      } else {
         do {
            ++var2;
            if (var2 >= this.j.a()) {
               return -this.j.a() - 1;
            }

            var3 = this.a(var2);
            if (var3 == var1) {
               return var2;
            }
         } while(var3 <= var1);

         return -var2 - 1;
      }
   }

   public int a(int var1, boolean var2) {
      if (var2) {
         if (var1 < 0) {
            if (this.h < 0) {
               this.r();
            }

            return this.j.a() - 1;
         } else {
            return var1 - 1;
         }
      } else {
         if (this.h < 0) {
            this.r();
         }

         if (var1 < 0) {
            return this.j.a() > 0 ? 0 : -1;
         } else {
            int var3 = var1 + 1;
            return var3 >= this.j.a() ? -this.j.a() - 1 : var3;
         }
      }
   }

   public zahl b() {
      if (this.h < 0) {
         this.r();
      }

      return new zso(this, -1, 0, -1, this.j.a() - 1, 1);
   }

   public zahl a(int var1, int var2, boolean var3) {
      int var4 = var1;
      int var5 = var2;
      if (this.h < 0) {
         this.r();
      }

      int var6;
      if (var1 < 0) {
         var4 = 0;
         var6 = -1;
      } else {
         var6 = this.a(var1);
      }

      int var7;
      if (var2 < 0) {
         var5 = this.j.a() - 1;
         var7 = -1;
      } else {
         var7 = this.a(var2);
      }

      return (zahl)(var3 ? new zsn(this, var6, var4, var7, var5, 1) : new zso(this, var6, var4, var7, var5, 1));
   }

   public zahl a(int var1, int var2, int var3, int var4, boolean var5) {
      if (this.h < 0) {
         this.r();
      }

      return (zahl)(var5 ? new zsn(this, var1, var2, var3, var4, 1) : new zso(this, var1, var2, var3, var4, 1));
   }

   public int c(int var1) {
      if (this.h < 0) {
         this.r();
      }

      return var1;
   }

   public int d(int var1) {
      return var1;
   }

   public void c(int var1, int var2) {
      int var3 = var1;
      if (this.h < 0) {
         this.r();
      }

      if (var2 < 0) {
         if (var1 < 0) {
            var3 = this.j.a() - 1;
         }

         this.d(var3 + var2 + 1, var3);
      } else {
         if (var1 < 0) {
            var3 = 0;
         }

         this.d(var3, var3 + var2 - 1);
      }

   }

   public int d(int var1, int var2) {
      int var3 = var1;
      int var4 = var2;
      if (this.h < 0) {
         this.r();
      }

      if (var1 < 0) {
         if (var2 < 0) {
            var4 = this.j.a();
         }

         var3 = 0;
      } else if (var2 < 0) {
         var4 = this.j.a();
      } else if (var2 < this.j.a()) {
         var4 = var2 + 1;
      }

      if (var3 == var4) {
         return 0;
      } else {
         if (var4 < this.j.a()) {
            this.c(var4, this.j.b(var4), this.j.b(var3) - this.j.b(var4));
         } else {
            this.h = this.j.b(var3);
         }

         this.j.a(var3, var4 - var3);
         this.t();
         this.s();
         return var4 - var3;
      }
   }

   public int e(int var1, int var2) {
      if (this.h < 0) {
         this.r();
      }

      if (var1 < 0) {
         if (var2 < 0) {
            return this.j.a();
         }

         var1 = 0;
      } else if (var2 < 0) {
         return this.j.a() - var1;
      }

      return var2 - var1 + 1;
   }

   public void e(int var1) {
      int var2;
      if (this.h >= 0 && this.j.a() >= 1) {
         var2 = this.j.b(0);
      } else {
         var2 = this.f + this.q();
      }

      if (var1 > -1) {
         var1 *= 14;
         if (this.g - var2 > var1) {
            this.e = this.c.a(this.e, this.f, var2, this.g, var1, true);
            this.u();
         }
      }

      if (this.h > var2) {
         this.h = var2;
         this.t();
         this.j.c();
         this.s();
      } else if (this.h < 0 && d(this.i, this.f, this.g) > var2) {
         this.m = (byte)(var2 - this.f - 7);
         this.i[this.f + 3] = this.m;
         this.i[var2] = 0;
         this.s();
      }

   }

   public boolean g(int var1, int var2) {
      return this.c(var1, var2, false);
   }

   public boolean l(int var1, int var2) {
      return this.c(var1, var2, true);
   }

   private boolean c(int var1, int var2, boolean var3) {
      if (this.h < 0) {
         this.r();
      }

      if (var1 < -1) {
         var1 = (int)((float)(this.g - this.f) / 100.0F * (float)(-var1 - 1));
      } else if (var1 < 0) {
         var1 = this.c.d();
      } else if (var1 > 0) {
         var1 *= 14;
      }

      if (this.g - this.h <= var1) {
         return false;
      } else {
         if (var2 < 0) {
            var2 = this.c.d();
         } else if (var2 > 0) {
            var2 *= 14;
         }

         if (this.g - this.h <= var2) {
            return false;
         } else {
            this.e = this.c.a(this.e, this.f, this.h, this.g, var2, var3);
            this.u();
            return true;
         }
      }
   }

   public Object k() {
      if (this.h < 0) {
         this.r();
      }

      int var1 = this.j.a();
      int[] var2 = this.j.d();
      int[] var3;
      if (var2.length != var1 + 3) {
         var3 = new int[var1 + 3];
         System.arraycopy(var2, 0, var3, 0, var1);
      } else {
         var3 = var2;
      }

      var3[var1] = this.h;
      var3[var1 + 1] = this.d;
      var3[var1 + 2] = this.e;
      return var3;
   }

   public void f(int var1, int var2) {
      int var3 = var1;
      if (this.h < 0) {
         this.r();
      }

      if (var1 < 0) {
         var3 = 0;
      }

      for(; var3 < this.j.a(); ++var3) {
         int var6 = this.j.b(var3);
         int var4;
         int var5;
         if ((this.i[var6] & 255 & 4) == 0) {
            var4 = this.i[var6 + 1] & 255;
            var5 = var4 + var2;
            if (var5 <= 255) {
               this.i[var6 + 1] = (byte)var5;
            } else {
               var6 += this.c(var3 + 1, var6 + 2, 1);
               this.s();
               this.i[var6] = (byte)(this.i[var6] | 4);
               this.n(var6 + 1, var5);
            }
         } else {
            var4 = (this.i[var6 + 1] & 255) << 8 | this.i[var6 + 2] & 255;
            var5 = var4 + var2;
            if (var5 > 255) {
               this.n(var6 + 1, var5);
            } else {
               var6 += this.c(var3 + 1, var6 + 3, -1);
               this.s();
               this.i[var6] = (byte)(this.i[var6] & 251);
               this.i[var6 + 1] = (byte)var5;
            }
         }
      }

   }

   public int a(zfv var1) {
      if (this.h < 0) {
         this.r();
      }

      int var2 = this.a((zfv)var1, -1, 7);
      this.w(var2);
      System.arraycopy(this.k, 0, this.i, this.h - var2, var2);
      return this.j.a() - 1;
   }

   private void w(int var1) {
      this.v(var1);
      this.j.a(this.h);
      this.h += var1;
      this.t();
      this.s();
   }

   private int a(zfv[] var1, int var2, int var3) {
      if (var3 == 1) {
         return this.a(var1[var2]);
      } else {
         if (this.h < 0) {
            this.r();
         }

         byte[] var4 = new byte[this.k.length * var1.length];
         this.j.c(var1.length);
         int var5 = 0;

         for(var3 += var2; var2 < var3; ++var2) {
            zfv var7 = var1[var2];
            this.j.a(this.h + var5);
            int var6 = this.a((zfv)var7, -1, 7);
            System.arraycopy(this.k, 0, var4, var5, var6);
            var5 += var6;
         }

         this.v(var5);
         System.arraycopy(var4, 0, this.i, this.h, var5);
         this.h += var5;
         this.t();
         this.s();
         return this.j.a() - var1.length;
      }
   }

   public int a(int var1, zfv var2) {
      if (var1 >= 0 && var1 < this.j.a()) {
         if (this.h < 0) {
            this.r();
         }

         int var3 = this.a((zfv)var2, -1, 7);
         int var4 = this.t(var1, var3);
         System.arraycopy(this.k, 0, this.i, var4, var3);
         return var1;
      } else {
         return this.a(var2);
      }
   }

   private int t(int var1, int var2) {
      int var3 = this.j.b(var1);
      var3 += this.c(var1, var3, var2);
      this.s();
      this.j.b(var1, var3);
      return var3;
   }

   public int a(int var1, zfv[] var2, int var3, int var4) {
      if (var4 < 1) {
         return var1;
      } else if (var1 >= 0 && var1 < this.j.a()) {
         if (var4 == 1) {
            return this.a(var1, var2[var3]);
         } else {
            if (this.h < 0) {
               this.r();
            }

            byte[] var5 = new byte[this.k.length * var4];
            int[] var6 = new int[var4];
            int var7 = this.j.b(var1);
            int var8 = 0;

            int var10;
            for(var10 = 0; var10 < var4; ++var10) {
               var6[var10] = var7 + var8;
               int var9 = this.a((zfv)var2[var10 + var3], -1, 7);
               System.arraycopy(this.k, 0, var5, var8, var9);
               var8 += var9;
            }

            var10 = this.c(var1, var7, var8);
            if (var10 != 0) {
               for(int var11 = 0; var11 < var6.length; ++var11) {
                  var6[var11] += var10;
               }

               var7 += var10;
            }

            this.j.a(var1, var6, 0, var6.length);
            System.arraycopy(var5, 0, this.i, var7, var8);
            this.s();
            return var1;
         }
      } else {
         return this.a(var2, var3, var4);
      }
   }

   public int a(int var1, zp var2, int var3, int var4, boolean var5) {
      if (var4 < 1) {
         return var1;
      } else {
         if (this.h < 0) {
            this.r();
         }

         if (var2 instanceof zbbi) {
            if (var1 < 0) {
               var1 = this.j.a();
            }

            zbbi var6 = (zbbi)var2;
            if (var3 < 0) {
               var3 = 0;
               if (var6.h < 0) {
                  var6.r();
               }
            }

            int var7 = var3 + var4;
            if (var7 < var6.j.a()) {
               var7 = var6.j.b(var7) - var6.j.b(var3);
            } else {
               var7 = var6.h - var6.j.b(var3);
               var4 = var6.j.a() - var3;
            }

            int[] var8;
            int var10;
            if (var1 < this.j.a()) {
               var8 = new int[var4];
               int[] var9 = var6.j.d();
               var10 = var9[var3];
               int var11 = this.j.b(var1);

               int var12;
               for(var12 = 0; var12 < var8.length; ++var12) {
                  var8[var12] = var9[var3 + var12] - var10 + var11;
               }

               var12 = this.c(var1, var11, var7);
               if (var12 != 0) {
                  for(int var13 = 0; var13 < var8.length; ++var13) {
                     var8[var13] += var12;
                  }

                  var11 += var12;
               }

               this.j.a(var1, var8, 0, var8.length);
               System.arraycopy(var6.i, var10, this.i, var11, var7);
            } else {
               this.v(var7);
               var8 = var6.j.d();
               int var14 = var8[var3];
               this.j.c(var4);

               for(var10 = 0; var10 < var4; ++var10) {
                  this.j.a(var8[var3 + var10] - var14 + this.h);
               }

               System.arraycopy(var6.i, var14, this.i, this.h, var7);
               this.h += var7;
               this.t();
            }

            this.s();
            return var1;
         } else {
            return super.a(var1, var2, var3, var4, var5);
         }
      }
   }

   public int a(int var1) {
      if (this.h < 0) {
         this.r();
      }

      int var2 = this.j.b(var1);
      if ((this.i[var2] & 255 & 4) == 0) {
         int var3 = this.i[var2 + 1] & 255;
         return var3;
      } else {
         return (this.i[var2 + 1] & 255) << 8 | this.i[var2 + 2] & 255;
      }
   }

   public int g(int var1) {
      if (this.h < 0) {
         this.r();
      }

      int var2 = this.j.b(var1);
      byte var3 = this.i[var2];
      int var4 = this.m(var2 + ((var3 & 255 & 4) == 0 ? 2 : 3), var3 & 255 & 3);
      return var4 < 0 ? -1 : var4 + 15;
   }

   public void j(int var1, int var2) {
      if (this.h < 0) {
         this.r();
      }

      int var3 = this.j.b(var1);
      byte var4 = this.i[var3];
      int var5 = var4 & 255 & 3;
      var2 -= 15;
      if (var2 < 0) {
         if (var5 > 0) {
            this.i[var3] = (byte)(this.i[var3] & 252);
            this.c(var1 + 1, var3 + ((var4 & 255 & 4) == 0 ? 2 : 3) + var5, -var5);
            this.s();
         }

      } else {
         int var6 = u(var2);
         if (var5 != var6) {
            this.i[var3] = (byte)(this.i[var3] & 252);
            this.i[var3] |= (byte)var6;
            var3 += this.c(var1 + 1, var3 + ((var4 & 255 & 4) == 0 ? 2 : 3) + var5, var6 - var5);
            this.s();
         }

         this.b(var3 + ((var4 & 255 & 4) == 0 ? 2 : 3), var2, var6);
      }
   }

   public int h(int var1) {
      if (this.h < 0) {
         this.r();
      }

      switch(this.i[this.j.b(var1)] & 255 & 248) {
      case 8:
      case 24:
      case 40:
      case 48:
      case 56:
         return 6;
      case 32:
         return 1;
      case 64:
      case 80:
      case 96:
      case 112:
      case 128:
      case 144:
      case 160:
      case 176:
         return 4;
      case 72:
      case 88:
         return 2;
      case 104:
      case 120:
      case 136:
      case 152:
      case 168:
      case 184:
      case 200:
      case 216:
      case 232:
         return 3;
      case 192:
      case 208:
      case 224:
      case 240:
         return 5;
      default:
         return 0;
      }
   }

   public Object i(int var1) {
      if (this.h < 0) {
         this.r();
      }

      int var2 = this.j.b(var1);
      switch(this.i[var2] & 255 & 248) {
      case 8:
         return (this.i[this.s(var2)] & 255) << 2 | 2;
      case 24:
         var2 = this.s(var2);
         return ((this.i[var2] & 255) << 8 | this.i[var2 + 1] & 255) << 2 | 2;
      case 32:
         return com.aspose.cells.b.a.zc.f(this.i, this.s(var2));
      case 40:
         return (this.i[this.s(var2)] & 255) - 256 << 2 | 2;
      case 48:
         return com.aspose.cells.b.a.zc.a(this.i, this.s(var2));
      case 56:
         var2 = this.s(var2);
         return ((this.i[var2] & 255) << 8 | this.i[var2 + 1] & 255) - 65536 << 2 | 2;
      case 64:
      case 128:
         return this.a.a[this.i[this.s(var2)] & 255];
      case 72:
         return zml.d;
      case 80:
      case 144:
         var2 = this.s(var2);
         return this.a.a[(this.i[var2] & 255) << 8 | this.i[var2 + 1] & 255];
      case 88:
         return zml.e;
      case 96:
      case 160:
         var2 = this.s(var2);
         return this.a.a[(this.i[var2] & 255) << 16 | (this.i[var2 + 1] & 255) << 8 | this.i[var2 + 2] & 255];
      case 104:
         return 7;
      case 112:
      case 176:
         var2 = this.s(var2);
         return this.a.a[(this.i[var2] & 255) << 24 | (this.i[var2 + 1] & 255) << 16 | (this.i[var2 + 2] & 255) << 8 | this.i[var2 + 3] & 255];
      case 120:
         return 0;
      case 136:
         return 15;
      case 152:
         return 23;
      case 168:
         return 29;
      case 184:
         return 36;
      case 192:
         return this.b.b[this.i[this.s(var2)] & 255];
      case 200:
         return 42;
      case 208:
         var2 = this.s(var2);
         return this.b.b[(this.i[var2] & 255) << 8 | this.i[var2 + 1] & 255];
      case 216:
         return -2;
      case 224:
         var2 = this.s(var2);
         return this.b.b[(this.i[var2] & 255) << 16 | (this.i[var2 + 1] & 255) << 8 | this.i[var2 + 2] & 255];
      case 232:
         return -1;
      case 240:
         var2 = this.s(var2);
         return this.b.b[(this.i[var2] & 255) << 24 | (this.i[var2 + 1] & 255) << 16 | (this.i[var2 + 2] & 255) << 8 | this.i[var2 + 3] & 255];
      default:
         return 0;
      }
   }

   private int u(int var1, int var2) {
      if (var1 < 0) {
         if (var1 > -257) {
            this.k[0] = (byte)(this.k[0] | 40);
            this.k[var2] = (byte)(var1 + 256);
            return 1;
         }

         if (var1 > -65536) {
            this.k[0] = (byte)(this.k[0] | 56);
            this.q(var2, var1 + 65536);
            return 2;
         }
      } else {
         if (var1 <= 255) {
            this.k[0] = (byte)(this.k[0] | 8);
            this.k[var2] = (byte)var1;
            return 1;
         }

         if (var1 <= 65535) {
            this.k[0] = (byte)(this.k[0] | 24);
            this.q(var2, var1);
            return 2;
         }
      }

      return -1;
   }

   public void b(int var1, zfv var2) {
      if (this.h < 0) {
         this.r();
      }

      int var3 = this.j.b(var1);
      int var4 = this.s(var3);
      this.k[0] = (byte)(this.i[var3] & 255 & 7);
      int var5 = this.a((zfv)var2, 1);
      if (this.i[var3] != this.k[0]) {
         int var6 = t(this.i[var3] & 255 & 248);
         if (var6 != var5) {
            int var7 = this.c(var1 + 1, var4 + var6, var5 - var6);
            this.s();
            if (var7 != 0) {
               var3 += var7;
               var4 += var7;
            }
         }

         this.i[var3] = this.k[0];
      }

      if (var5 > 0) {
         System.arraycopy(this.k, 1, this.i, var4, var5);
      }

   }

   public int j(int var1) {
      if (this.h < 0) {
         this.r();
      }

      var1 = this.j.b(var1);
      switch(this.i[var1] & 255 & 248) {
      case 64:
      case 128:
      case 192:
         int var2 = this.i[this.s(var1)] & 255;
         return var2;
      case 80:
      case 144:
      case 208:
         var1 = this.s(var1);
         return (this.i[var1] & 255) << 8 | this.i[var1 + 1] & 255;
      case 96:
      case 160:
      case 224:
         var1 = this.s(var1);
         return (this.i[var1] & 255) << 16 | (this.i[var1 + 1] & 255) << 8 | this.i[var1 + 2] & 255;
      case 112:
      case 176:
      case 240:
         var1 = this.s(var1);
         return (this.i[var1] & 255) << 24 | (this.i[var1 + 1] & 255) << 16 | (this.i[var1 + 2] & 255) << 8 | this.i[var1 + 3] & 255;
      default:
         return -1;
      }
   }

   public void k(int var1, int var2) {
      if (this.h < 0) {
         this.r();
      }

      int var3 = this.j.b(var1);
      int var4;
      int var5;
      int var6;
      switch(this.i[var3] & 255 & 248) {
      case 64:
      case 128:
      case 192:
         var4 = u(var2);
         var5 = this.s(var3);
         if (var4 != 1) {
            var6 = this.c(var1 + 1, var5 + 1, var4 - 1);
            this.s();
            if (var6 != 0) {
               var3 += var6;
               var5 += var6;
            }

            this.i[var3] = (byte)((this.i[var3] & 255) + (var4 - 1 << 4));
            this.b(var5, var2, var4);
         } else {
            this.i[var5] = (byte)var2;
         }

         return;
      case 80:
      case 144:
      case 208:
         var4 = u(var2);
         var5 = this.s(var3);
         if (var4 != 2) {
            var6 = this.c(var1 + 1, var5 + 2, var4 - 2);
            this.s();
            if (var6 != 0) {
               var3 += var6;
               var5 += var6;
            }

            this.i[var3] = (byte)((this.i[var3] & 255) + (var4 - 2 << 4));
            this.b(var5, var2, var4);
         } else {
            this.n(var5, var2);
         }

         return;
      case 96:
      case 160:
      case 224:
         var4 = u(var2);
         var5 = this.s(var3);
         if (var4 != 3) {
            var6 = this.c(var1 + 1, var5 + 3, var4 - 3);
            this.s();
            if (var6 != 0) {
               var3 += var6;
               var5 += var6;
            }

            this.i[var3] = (byte)((this.i[var3] & 255) + (var4 - 3 << 4));
            this.b(var5, var2, var4);
         } else {
            this.o(var5, var2);
         }

         return;
      case 112:
      case 176:
      case 240:
         var4 = u(var2);
         var5 = this.s(var3);
         if (var4 != 4) {
            var6 = this.c(var1 + 1, var5 + 4, var4 - 4);
            this.s();
            if (var6 != 0) {
               var3 += var6;
               var5 += var6;
            }

            this.i[var3] = (byte)((this.i[var3] & 255) + (var4 - 4 << 4));
            this.b(var5, var2, var4);
         } else {
            this.p(var5, var2);
         }

         return;
      default:
      }
   }

   public zfv c(int var1, zfv var2) {
      if (this.h < 0) {
         this.r();
      }

      var2.e = false;
      var1 = this.j.b(var1);
      switch(this.i[var1] & 255 & 248) {
      case 8:
         zavz.a((long)(this.i[this.s(var1)] & 255 & 255), var2);
         break;
      case 24:
         var1 = this.s(var1);
         zavz.a((long)((this.i[var1] & 255) << 8 | this.i[var1 + 1] & 255), var2);
         break;
      case 32:
         var2.c = 1;
         var2.d = com.aspose.cells.b.a.zc.f(this.i, this.s(var1));
         break;
      case 40:
         zavz.a((long)((this.i[this.s(var1)] & 255) - 256), var2);
         break;
      case 48:
         var2.c = 6;
         var2.d = com.aspose.cells.b.a.zc.a(this.i, this.s(var1));
         break;
      case 56:
         var1 = this.s(var1);
         zavz.a((long)(((this.i[var1] & 255) << 8 | this.i[var1 + 1] & 255) - 65536), var2);
         break;
      case 64:
         var2.e = false;
         var2.c = 4;
         var2.d = this.a.a[this.i[this.s(var1)] & 255];
         break;
      case 72:
         var2.c = 2;
         var2.d = zml.d;
         break;
      case 80:
         var2.e = false;
         var2.c = 4;
         var1 = this.s(var1);
         var2.d = this.a.a[(this.i[var1] & 255) << 8 | this.i[var1 + 1] & 255];
         break;
      case 88:
         var2.c = 2;
         var2.d = zml.e;
         break;
      case 96:
         var2.e = false;
         var2.c = 4;
         var1 = this.s(var1);
         var2.d = this.a.a[(this.i[var1] & 255) << 16 | (this.i[var1 + 1] & 255) << 8 | this.i[var1 + 2] & 255];
         break;
      case 104:
         var2.c = 3;
         var2.d = com.aspose.cells.a.c.zi.a((byte)7);
         break;
      case 112:
         var2.e = false;
         var2.c = 4;
         var1 = this.s(var1);
         var2.d = this.a.a[(this.i[var1] & 255) << 24 | (this.i[var1 + 1] & 255) << 16 | (this.i[var1 + 2] & 255) << 8 | this.i[var1 + 3] & 255];
         break;
      case 120:
         var2.c = 3;
         var2.d = com.aspose.cells.a.c.zi.a((byte)0);
         break;
      case 128:
         var2.e = true;
         var2.c = 4;
         var2.d = this.a.a[this.i[this.s(var1)] & 255];
         break;
      case 136:
         var2.c = 3;
         var2.d = com.aspose.cells.a.c.zi.a((byte)15);
         break;
      case 144:
         var2.e = true;
         var2.c = 4;
         var1 = this.s(var1);
         var2.d = this.a.a[(this.i[var1] & 255) << 8 | this.i[var1 + 1] & 255];
         break;
      case 152:
         var2.c = 3;
         var2.d = com.aspose.cells.a.c.zi.a((byte)23);
         break;
      case 160:
         var2.e = true;
         var2.c = 4;
         var1 = this.s(var1);
         var2.d = this.a.a[(this.i[var1] & 255) << 16 | (this.i[var1 + 1] & 255) << 8 | this.i[var1 + 2] & 255];
         break;
      case 168:
         var2.c = 3;
         var2.d = com.aspose.cells.a.c.zi.a((byte)29);
         break;
      case 176:
         var2.e = true;
         var2.c = 4;
         var1 = this.s(var1);
         var2.d = this.a.a[(this.i[var1] & 255) << 24 | (this.i[var1 + 1] & 255) << 16 | (this.i[var1 + 2] & 255) << 8 | this.i[var1 + 3] & 255];
         break;
      case 184:
         var2.c = 3;
         var2.d = com.aspose.cells.a.c.zi.a((byte)36);
         break;
      case 192:
         var2.c = 5;
         var2.d = this.b.b[this.i[this.s(var1)] & 255];
         break;
      case 200:
         var2.c = 3;
         var2.d = com.aspose.cells.a.c.zi.a((byte)42);
         break;
      case 208:
         var2.c = 5;
         var1 = this.s(var1);
         var2.d = this.b.b[(this.i[var1] & 255) << 8 | this.i[var1 + 1] & 255];
         break;
      case 216:
         var2.c = 3;
         var2.d = com.aspose.cells.a.c.zi.a((byte)-2);
         break;
      case 224:
         var2.c = 5;
         var1 = this.s(var1);
         var2.d = this.b.b[(this.i[var1] & 255) << 16 | (this.i[var1 + 1] & 255) << 8 | this.i[var1 + 2] & 255];
         break;
      case 232:
         var2.c = 3;
         var2.d = com.aspose.cells.a.c.zi.a((byte)-1);
         break;
      case 240:
         var2.c = 5;
         var1 = this.s(var1);
         var2.d = this.b.b[(this.i[var1] & 255) << 24 | (this.i[var1 + 1] & 255) << 16 | (this.i[var1 + 2] & 255) << 8 | this.i[var1 + 3] & 255];
         break;
      default:
         var2.c = 0;
         var2.d = null;
      }

      return var2;
   }

   public boolean c() {
      return false;
   }

   public boolean d() {
      return false;
   }

   public boolean e() {
      return false;
   }

   public zfv a(int var1, zfv var2, int var3) {
      if ((var3 & 4) != 0) {
         this.c(var1, var2);
      }

      var1 = this.j.b(var1);
      byte var4 = this.i[var1];
      if ((var4 & 255 & 4) == 0) {
         if ((var3 & 1) != 0) {
            var2.a = (short)(this.i[var1 + 1] & 255);
         }

         if ((var3 & 2) != 0) {
            var2.b = this.m(var1 + 2, var4 & 255 & 3);
            var2.b = var2.b < 0 ? -1 : var2.b + 15;
         }
      } else {
         if ((var3 & 1) != 0) {
            var2.a = (short)((this.i[var1 + 1] & 255) << 8 | this.i[var1 + 2] & 255);
         }

         if ((var3 & 2) != 0) {
            var2.b = this.m(var1 + 3, var4 & 255 & 3);
            var2.b = var2.b < 0 ? -1 : var2.b + 15;
         }
      }

      return var2;
   }

   public void b(int var1, zfv var2, int var3) {
      if (this.h < 0) {
         this.r();
      }

      switch(var3) {
      case 1:
         throw new CellsException(7, "Column index should not be changed when setting properties");
      case 2:
         this.j(var1, var2.b);
         return;
      case 3:
      default:
         int var4 = this.j.b(var1);
         int var6;
         if ((var3 & 4) == 0) {
            byte var5 = this.i[var4];
            var6 = ((var5 & 255 & 4) == 0 ? 2 : 3) + (var5 & 255 & 3);
            int var7 = this.b(var2, var1, var3);
            if (var7 != var6) {
               var4 += this.c(var1 + 1, var4 + var6, var7 - var6);
               this.s();
            }

            var5 = (byte)(this.k[0] & 255 | var5 & 255 & 248);
            this.i[var4] = var5;
            System.arraycopy(this.k, 1, this.i, var4 + 1, var7 - 1);
         } else {
            int var8 = this.a(var2, var1, var3);
            var6 = (var1 < this.j.a() - 1 ? this.j.b(var1 + 1) : this.h) - var4;
            if (var8 != var6) {
               var4 += this.c(var1 + 1, var4 + var6, var8 - var6);
               this.s();
            }

            System.arraycopy(this.k, 0, this.i, var4, var8);
         }

         return;
      case 4:
         this.b(var1, var2);
      }
   }

   public int h() {
      return this.d;
   }

   public int i() {
      byte var1 = this.i[this.f + 4];
      int var2 = (var1 & 255 & 24) >> 3;
      return var2 > 0 ? this.m(this.f + 5 + (var1 & 255 & 3) + ((var1 & 255 & 4) == 0 ? 2 : 3), var2) + 16 : 15;
   }

   public void k(int var1) {
      var1 -= 16;
      int var2 = var1 < 0 ? 0 : u(var1);
      byte var3 = this.i[this.f + 4];
      int var4 = (var3 & 255 & 24) >> 3;
      int var5 = this.f + 5 + (var3 & 255 & 3) + ((var3 & 255 & 4) == 0 ? 2 : 3);
      if (var2 != var4) {
         if (this.h < 0) {
            this.r();
         }

         var5 += this.c(0, var5 + var4, var2 - var4);
         this.s();
         this.b(var5, var1, var2);
         var5 = this.f + 4;
         this.i[var5] = (byte)(this.i[var5] & 231);
         this.i[var5] |= (byte)(var2 << 3);
      } else {
         this.b(var5, var1, var2);
      }

   }

   public int j() {
      byte var1 = this.i[this.f + 4];
      return this.m(this.f + 5 + (var1 & 255 & 3) + 1, (var1 & 255 & 4) == 0 ? 1 : 2);
   }

   public void m(int var1) {
      byte var2 = this.i[this.f + 4];
      int var3 = ((var2 & 255 & 4) >> 2) + 1;
      int var4 = this.f + 5 + (var2 & 255 & 3) + 1;
      if ((var2 & 255 & 4) != 0) {
         if (var1 > 255) {
            this.n(var4, var1);
         } else {
            if (this.h < 0) {
               this.r();
            }

            this.i[this.f + 4] = (byte)(this.i[this.f + 4] & 251);
            var4 += this.c(0, var4 + 2, -1);
            this.s();
            this.i[var4] = (byte)var1;
         }
      } else if (var1 > 255) {
         if (this.h < 0) {
            this.r();
         }

         this.i[this.f + 4] = (byte)(this.i[this.f + 4] | 4);
         var4 += this.c(0, var4 + 1, 1);
         this.s();
         this.n(var4, var1);
      } else {
         this.i[var4] = (byte)var1;
      }

   }

   public byte l(int var1) {
      return this.i[this.f + 0 + var1];
   }

   public void a(int var1, byte var2) {
      this.i[this.f + 0 + var1] = var2;
   }

   public zbbj a(zbbj var1, int var2) {
      a(this.i, this.f, var1, var2);
      return var1;
   }

   public void b(zbbj var1, int var2) {
      switch(var2) {
      case 1:
         this.i[this.f + 0] = var1.b;
         this.i[this.f + 0 + 1] = var1.c;
         return;
      case 2:
         throw new CellsException(7, "Row index should not be changed when setting properties");
      case 3:
      case 5:
      case 6:
      case 7:
      default:
         if ((var2 & 1) != 0) {
            this.i[this.f + 0] = var1.b;
            this.i[this.f + 0 + 1] = var1.c;
         }

         if (var2 < 4) {
            return;
         }

         int var3 = this.i[this.f + 4];
         int var4 = this.f + 5 + (var3 & 255 & 3) + 1;
         byte var6 = 0;
         int var5;
         int var9;
         if ((var2 & 4) != 0) {
            if (var1.e > 255) {
               this.q(var6, var1.e);
               var9 = var6 + 2;
               if ((var3 & 255 & 4) == 0) {
                  var3 = (byte)(var3 | 4);
                  var5 = var4 + 1;
               } else {
                  var5 = var4 + 2;
               }
            } else {
               this.k[var6] = (byte)var1.e;
               var9 = var6 + 1;
               if ((var3 & 255 & 4) != 0) {
                  var3 = (byte)(var3 & 251);
                  var5 = var4 + 2;
               } else {
                  var5 = var4 + 1;
               }
            }
         } else {
            var9 = var6 + 1;
            var5 = var4 + 1;
            this.k[var6] = this.i[var4];
            if ((var3 & 255 & 4) != 0) {
               this.k[var9++] = this.i[var5++];
            }
         }

         if ((var2 & 8) != 0) {
            if (var1.d > 15) {
               int var7 = var1.d - 16;
               byte var8;
               if (var7 <= 255) {
                  this.k[var9] = (byte)var7;
                  ++var9;
                  switch(var3 & 255 & 24) {
                  case 0:
                     var3 = (byte)(var3 | 8);
                     break;
                  case 8:
                     ++var5;
                     break;
                  case 16:
                     var8 = (byte)(var3 & 231);
                     var3 = (byte)(var8 | 8);
                     var5 += 2;
                     break;
                  case 24:
                     var3 = (byte)(var3 & 239);
                     var5 += 3;
                  }
               } else if (var7 <= 65535) {
                  this.q(var9, var7);
                  var9 += 2;
                  switch(var3 & 255 & 24) {
                  case 0:
                     var3 = (byte)(var3 | 16);
                     break;
                  case 8:
                     var8 = (byte)(var3 & 231);
                     var3 = (byte)(var8 | 16);
                     ++var5;
                     break;
                  case 16:
                     var5 += 2;
                     break;
                  case 24:
                     var3 = (byte)(var3 & 247);
                     var5 += 3;
                  }
               } else {
                  this.r(var9, var7);
                  var9 += 3;
                  switch(var3 & 255 & 24) {
                  case 0:
                     var3 = (byte)(var3 | 24);
                     break;
                  case 3:
                     var5 += 3;
                     break;
                  case 8:
                     var3 = (byte)(var3 | 16);
                     ++var5;
                     break;
                  case 16:
                     var3 = (byte)(var3 | 8);
                     var5 += 2;
                  }
               }
            } else {
               var5 += (var3 & 255 & 24) >> 3;
               var3 = (byte)(var3 & 231);
            }
         } else {
            switch(var3 & 255 & 24) {
            case 8:
               this.k[var9++] = this.i[var5++];
               break;
            case 16:
               this.k[var9++] = this.i[var5++];
               this.k[var9++] = this.i[var5++];
               break;
            case 24:
               this.k[var9++] = this.i[var5++];
               this.k[var9++] = this.i[var5++];
               this.k[var9++] = this.i[var5++];
            }
         }

         if (var9 != var5 - var4) {
            if (this.h < 0) {
               this.r();
            }

            var4 += this.c(0, var5, var9 - (var5 - var4));
            this.s();
         }

         this.i[this.f + 4] = (byte)var3;
         System.arraycopy(this.k, 0, this.i, var4, var9);
         return;
      case 4:
         this.m(var1.e);
         return;
      case 8:
         this.k(var1.d);
      }
   }

   static int n(int var0) {
      return 10 + u(var0);
   }

   static int o(int var0) {
      return 7 + u(var0);
   }

   static int p(int var0) {
      return var0 * 2;
   }

   static int q(int var0) {
      return var0 * 7;
   }

   static int a(byte[] var0, int var1) {
      switch(var0[var1 + 4] & 255 & 3) {
      case 0:
         int var2 = var0[var1 + 5] & 255;
         return var2;
      case 1:
         var1 += 5;
         return (var0[var1] & 255) << 8 | var0[var1 + 1] & 255;
      case 2:
         var1 += 5;
         return (var0[var1] & 255) << 16 | (var0[var1 + 1] & 255) << 8 | var0[var1 + 2] & 255;
      case 3:
         var1 += 5;
         return (var0[var1] & 255) << 24 | (var0[var1 + 1] & 255) << 16 | (var0[var1 + 2] & 255) << 8 | var0[var1 + 3] & 255;
      default:
         return -1;
      }
   }

   static void a(byte[] var0, int var1, zbbj var2, int var3) {
      if ((var3 & 1) != 0) {
         var2.b = var0[var1 + 0];
         var2.c = var0[var1 + 0 + 1];
      }

      if (var3 >= 2) {
         byte var4 = var0[var1 + 4];
         var1 += 5;
         int var5 = (var4 & 255 & 3) + 1;
         if ((var3 & 2) != 0) {
            var2.a = h(var0, var1, var5);
         }

         if (var3 >= 4) {
            var1 += var5;
            var5 = (var4 & 255 & 4) == 0 ? 1 : 2;
            if ((var3 & 4) != 0) {
               var2.e = (short)h(var0, var1, var5);
            }

            if (var3 >= 8) {
               var1 += var5;
               var5 = (var4 & 255 & 24) >> 3;
               if (var5 > 0) {
                  var2.d = h(var0, var1, var5) + 16;
               } else {
                  var2.d = 15;
               }

            }
         }
      }
   }

   static byte a(byte[] var0, int var1, int var2) {
      return var0[var1 + 0 + var2];
   }

   static void a(byte[] var0, int var1, int var2, byte var3) {
      var0[var1 + 0 + var2] = var3;
   }

   static int b(byte[] var0, int var1) {
      byte var2 = var0[var1 + 4];
      return h(var0, var1 + 5 + (var2 & 255 & 3) + 1, (var2 & 255 & 4) == 0 ? 1 : 2);
   }

   static int a(byte[] var0, int var1, int var2, zbbj var3) {
      var0[var1 + 0] = var3.b;
      var0[var1 + 0 + 1] = var3.c;
      byte var4 = 0;
      int var5 = var1 + 5;
      if (var3.a > 16777215) {
         var4 = 3;
         g(var0, var5, var3.a);
         var5 += 4;
      } else if (var3.a > 65535) {
         var4 = 2;
         f(var0, var5, var3.a);
         var5 += 3;
      } else if (var3.a > 255) {
         var4 = 1;
         e(var0, var5, var3.a);
         var5 += 2;
      } else {
         var0[var5] = (byte)var3.a;
         ++var5;
      }

      if (var3.e > 255) {
         var4 = (byte)(var4 | 4);
         e(var0, var5, var3.e);
         var5 += 2;
      } else {
         var0[var5] = (byte)var3.e;
         ++var5;
      }

      if (var3.d > 15) {
         int var6 = var3.d - 16;
         if (var6 <= 255) {
            var4 = (byte)(var4 | 8);
            var0[var5] = (byte)var6;
            ++var5;
         } else if (var6 <= 65535) {
            var4 = (byte)(var4 | 16);
            e(var0, var5, var6);
            var5 += 2;
         } else {
            var4 = (byte)(var4 | 24);
            f(var0, var5, var6);
            var5 += 3;
         }
      }

      var0[var1 + 4] = var4;
      var0[var1 + 3] = (byte)(var5 - var1 - 7);
      if (var5 < var2) {
         var0[var5] = 0;
      }

      return var5;
   }

   static int b(byte[] var0, int var1, int var2) {
      int var3;
      byte var4;
      switch(var0[var1 + 4] & 255 & 3) {
      case 0:
         var3 = (var0[var1 + 5] & 255) + var2;
         if (var3 <= 255) {
            var0[var1 + 5] = (byte)var3;
            return 0;
         }

         var4 = 1;
         break;
      case 1:
         var1 += 5;
         var3 = ((var0[var1] & 255) << 8 | var0[var1 + 1] & 255) + var2;
         if (var3 > 255 && var3 <= 65535) {
            e(var0, var1, var3);
            return 0;
         }

         var4 = 2;
         break;
      case 2:
         var1 += 5;
         var3 = ((var0[var1] & 255) << 16 | (var0[var1 + 1] & 255) << 8 | var0[var1 + 2] & 255) + var2;
         if (var3 > 65535 && var3 <= 16777215) {
            f(var0, var1, var3);
            return 0;
         }

         var4 = 3;
         break;
      default:
         var1 += 5;
         var3 = ((var0[var1] & 255) << 24 | (var0[var1 + 1] & 255) << 16 | (var0[var1 + 2] & 255) << 8 | var0[var1 + 3] & 255) + var2;
         if (var3 > 16777215) {
            g(var0, var1, var3);
            return 0;
         }

         var4 = 4;
      }

      return u(var3) - var4;
   }

   static void a(byte[] var0, int var1, int var2, int var3, int var4, int var5) {
      var0[var1 + 3] = (byte)Math.min(255, (var0[var1 + 3] & 255) + var5);
      int var6 = var0[var1 + 4] & 255;
      var0[var1 + 4] = (byte)(var0[var1 + 4] & 252);
      var1 += 5;
      byte var7;
      switch(var6 & 3) {
      case 0:
         var6 = (var0[var1] & 255) + var4;
         var7 = 1;
         break;
      case 1:
         var6 = ((var0[var1] & 255) << 8 | var0[var1 + 1] & 255) + var4;
         var7 = 2;
         break;
      case 2:
         var6 = ((var0[var1] & 255) << 16 | (var0[var1 + 1] & 255) << 8 | var0[var1 + 2] & 255) + var4;
         var7 = 3;
         break;
      default:
         var6 = ((var0[var1] & 255) << 24 | (var0[var1 + 1] & 255) << 16 | (var0[var1 + 2] & 255) << 8 | var0[var1 + 3] & 255) + var4;
         var7 = 4;
      }

      var1 += var7;
      System.arraycopy(var0, var1, var0, var1 + var5, var2 - var1);
      var2 += var5;
      if (var2 < var3) {
         var0[var2] = 0;
      }

      var1 -= var7;
      switch(var7 + var5) {
      case 1:
         var0[var1] = (byte)var6;
         break;
      case 2:
         var0[var1 - 5 + 4] = (byte)(var0[var1 - 5 + 4] | 1);
         e(var0, var1, var6);
         break;
      case 3:
         var0[var1 - 5 + 4] = (byte)(var0[var1 - 5 + 4] | 2);
         f(var0, var1, var6);
         break;
      case 4:
         var0[var1 - 5 + 4] = (byte)(var0[var1 - 5 + 4] | 3);
         g(var0, var1, var6);
      }

   }

   static void c(byte[] var0, int var1, int var2) {
      if (var1 < var2) {
         var0[var1] = 0;
      }

   }

   static int d(byte[] var0, int var1, int var2) {
      if ((var0[var1 + 3] & 255) != 255) {
         return var1 + 7 + (var0[var1 + 3] & 255);
      } else {
         byte var3 = var0[var1 + 4];

         int var4;
         for(var4 = var1 + 5 + (var3 & 255 & 3) + ((var3 & 255 & 4) == 0 ? 2 : 3) + ((var3 & 255 & 24) >> 3); var4 < var2; var4 += (var3 & 255 & 3) + ((var3 & 255 & 4) == 0 ? 2 : 3) + t(var3 & 255 & 248)) {
            if (var0[var4] == 0) {
               return var4;
            }

            var3 = var0[var4];
         }

         return var4;
      }
   }

   private static void e(byte[] var0, int var1, int var2) {
      var0[var1] = (byte)(var2 >> 8);
      var0[var1 + 1] = (byte)(var2 & 255);
   }

   private static void f(byte[] var0, int var1, int var2) {
      var0[var1] = (byte)(var2 >> 16);
      var0[var1 + 1] = (byte)(var2 >> 8 & 255);
      var0[var1 + 2] = (byte)(var2 & 255);
   }

   private static void g(byte[] var0, int var1, int var2) {
      var0[var1] = (byte)(var2 >> 24);
      var0[var1 + 1] = (byte)(var2 >> 16 & 255);
      var0[var1 + 2] = (byte)(var2 >> 8 & 255);
      var0[var1 + 3] = (byte)(var2 & 255);
   }

   private static int h(byte[] var0, int var1, int var2) {
      switch(var2) {
      case 1:
         int var3 = var0[var1] & 255;
         return var3;
      case 2:
         return (var0[var1] & 255) << 8 | var0[var1 + 1] & 255;
      case 3:
         return (var0[var1] & 255) << 16 | (var0[var1 + 1] & 255) << 8 | var0[var1 + 2] & 255;
      case 4:
         return (var0[var1] & 255) << 24 | (var0[var1 + 1] & 255) << 16 | (var0[var1 + 2] & 255) << 8 | var0[var1 + 3] & 255;
      default:
         return -1;
      }
   }
}
